
#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <stdexcept>
#include <Volume.h>
#include <Length.h>


USING_MOCKCPP_NS
USING_TESTNGPP_NS

FIXTURE(Volume)
{
    TEST(should be able check equation of 1 OZ and 3 TBS)
    {
        ASSERT_EQ(Volume(1, OZ), Volume(3, TSP));
    }

    TEST(should be able to check equation of 1 TSP and 16 TBSP)
    {
        ASSERT_EQ(Volume(1, TSP), Volume(4, TBSP));
    }
    TEST(should be able to check equation of 1 OZ and 12 TSP)
    {
        ASSERT_EQ(Volume(1, OZ), Volume(12, TBSP));
    }

    TEST(should be able check equation of 1 OZ + 3 TSP = 6 TSP)
    {
        ASSERT_EQ(Volume(6, TSP),Volume(1, OZ)+Volume(3, TSP));
    }
    
    TEST(should be able check equation of 1 OZ + 3 TSP = 2 OZ)
    {
        ASSERT_EQ(Volume(2, OZ),Volume(1, OZ)+Volume(3, TSP));
    }

    TEST(should be able to check equation of 2 TSP + 4 TBSP = 3 TSP)
    {
        ASSERT_EQ(Volume(12, TBSP),Volume(2, TSP)+Volume(4, TBSP));
    }

    TEST(should be able to check equation of 1 OZ + 4 TBSP = 16 TSP)
    {
        ASSERT_EQ(Volume(16, TBSP),Volume(4, TBSP)+Volume(1, OZ));
    }
  

    TEST(Length  and Volume  can not be compareed)
    {
       ASSERT_THROWS((Volume(1, TSP)==Length(1, YARD)), std::invalid_argument);   
    } 

    TEST(Length  and Volume  can not be compareed)
    {
        ASSERT_THROWS((Volume(1, TBSP)==Length(1, FEET)), std::invalid_argument);  
    } 

    TEST(Length  and Volume  can not be compareed)
    {
        ASSERT_THROWS((Volume(1, OZ)+Length(1, MILE)), std::invalid_argument);
    } 


  	
    TEST("10 TSP format to string is: 3 OZ 1 TSP")
    {
        Volume  volume(10, TSP);
        ASSERT_EQ(std::string("3 OZ 1 TSP"), volume.printInUnitFormat());
    }
    TEST("15 TBSP format to string is: 1 OZ 3 TBSP")
    {
        Volume  volume(15, TBSP);
        ASSERT_EQ(std::string("1 OZ 3 TBSP"), volume.printInUnitFormat());
    } 

    TEST("0 OZ format to string is: 0 TBSP")
    {
        Volume  volume(0, OZ);
        ASSERT_EQ(std::string("0 TBSP"), volume.printInUnitFormat());
    }

    TEST("10 TSP format to min unit string is: 40 TBSP")
    {
        Volume  volume(10, TSP);
        ASSERT_EQ(std::string("40 TBSP"), volume.printInMinUnitFormat());
    }
    TEST("1 OZ format to min unit string is: 12 TBSP")
    {
        Volume  volume(1, OZ);
        ASSERT_EQ(std::string("12 TBSP"), volume.printInMinUnitFormat());
    } 
    TEST("0 OZ format to string is: 0 TBSP")
    {
        Volume  volume(0, OZ);
        ASSERT_EQ(std::string("0 TBSP"), volume.printInMinUnitFormat());
    }

};





